export default {
  namespace: 'componentManage',
  state: {
    selectComponent: {}, // 组件列表选中数据
    componentAddVisibleFlag: false, // 组件新增弹窗展示/隐藏标记
    componentAddType: null, // 组件新增类型： add，modify
    selectComponentAttr: {}, // 组件属性列表选中数据
    componentAttrAddList: [], // 组件属性数据列表
    componentAttrAddVisibleFlag: false, // 组件属性新增弹窗展示/隐藏标记
    componentAttrAddType: null // 组件属性元素新增类型： edit
  },

  effects: {},

  reducers: {
    saveSelectComponent(state, { payload: params }) {
      return {
        ...state,
        selectComponent: params,
      };
    },
    saveComponentAddVisibleFlag(state, { payload: params }) {
      return {
        ...state,
        componentAddVisibleFlag: params,
      };
    },
    saveComponentAddType(state, { payload: params }) {
      return {
        ...state,
        componentAddType: params,
      };
    },
    saveSelectComponentAttr(state, { payload: params }) {
      return {
        ...state,
        selectComponentAttr: params,
      };
    },
    saveComponentAttrAddVisibleFlag(state, { payload: params }) {
      return {
        ...state,
        componentAttrAddVisibleFlag: params,
      };
    },
    saveComponentAttrAddType(state, { payload: params }) {
      return {
        ...state,
        componentAttrAddType: params,
      };
    },
    saveComponentAttrAddList(state, { payload: params }) {
      return {
        ...state,
        componentAttrAddList: params,
      };
    },
  },
};
